Skip to content

fix(security): validate ingestId param on ingest routes - #299

Open
birme wants to merge 1 commit into
mainfrom
bug-fixer/257-ingest-params-schema
Open

fix(security): validate ingestId param on ingest routes#299
birme wants to merge 1 commit into
mainfrom
bug-fixer/257-ingest-params-schema

Conversation

@birme

@birme birme commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a TypeBox params schema (ingestId as a non-empty numeric string, ^[0-9]+$) to the GET, PATCH and DELETE /api/v1/ingests/:ingestId routes in src/api_ingests.ts.
  • Previously ingestId was declared only as a TS generic with no Fastify schema, so it reached parseInt unvalidated. Malformed input is now rejected with 400 before any handler logic runs.
  • Existing response schemas and handler logic are unchanged.

Test plan

  • npm run typecheck clean
  • npm test — 243/243 pass (worker teardown warning is pre-existing/expected)
  • npm run lint — 0 errors (pre-existing warnings only)

Closes #257

Add TypeBox params schema (ingestId as a non-empty numeric string) to the
GET, PATCH and DELETE /ingest/:ingestId routes so ingestId is validated by
Fastify before parseInt, rejecting malformed input with 400.

Closes #257

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security: Missing TypeBox params schema on GET/PATCH/DELETE /ingest/:ingestId routes

2 participants